<!DOCTYPE html>
<html lang="en">
<head>
<title>顶部权限数据管理页</title> 
#@common()
<style type="text/css">
body { padding: 10px; background: #fff; }
/* .layui-form-label { min-width: 200px; } */
</style>
</head>
<body>
	<form class="layui-form layui-fluid" action="option/save">
		<input type="hidden" name="id" value="#(option.id)" />
		<div class="layui-form-item layui-form-text">
    		<div class="layui-input-inline" style="width: 100%;">
     		 	<textarea name="func" placeholder="请输入站内信请求方法" class="layui-textarea" style="height: 550px;">#if(option.func??)#(option.func)#else#(func)#end</textarea>
    		</div>
  		</div>
		
		<div class="layui-form-item">
			<div class="text-right">
				<button class="layui-btn layui-bg-blue" lay-submit lay-filter="option">保存数据</button>
				<button type="button" class="layui-btn layui-btn-primary" onclick="closeLayer()">关闭返回</button>
			</div>
		</div>
	</form>

	<script>
		//layui的相关数据加载
		layui.use('form', function() {
			var form = layui.form;
			//监听提交
			form.on('submit(option)', function(data) {
				Http.post('admin/option/save', data.field, function(res){
					if(res.succeed){
						parent.layer.msg('保存成功',{shade:0.1})
						closeLayer();
					} else {
						parent.layer.msg(res.message)
					}
				})
				return false;
			});
		});
		
		/** 关闭系统菜单录入页面 */
		function closeLayer(){
			parent.jqGrid.reload();
			closeParentLayer();
		}
		
	</script>
</body>
</html>